<%-- 
    Document   : productlistadminview
    Created on : Mar 30, 2014, 9:07:17 AM
    Author     : windows 7 Ult
--%>

        <%@include file="headerAdmin.jsp" %>

        <sql:query dataSource="${conn}" var="result">
            SELECT name,quantity,id from Product where categoryId=?
            <sql:param value="${param.id}" />
        </sql:query>
        <div class="top_bg">
            <div class="wrap">
                <div class="main_top">
                    <h2 class="style">Category Products</h2>
                </div>
            </div>
        </div>
        <div class="container">
            <div class="row">
                <div class="col-md-6" style="margin-left: 60px;margin-top: 20px">
                    <div class="main_top">
                        <a href="addProduct.jsp" class="btn btn-success btn-sm">Add Product</a>
                        <table class="table table-bordered table-hover" style="margin-top: 20px;">
                            <tr>
                                <th>Product Name</th>
                                <th> Quantity</th>
              
                                <th>Operations</th>
                            </tr>
                            <c:forEach var="row" items="${result.rows}">

                                <tr>
                                    <td><c:out value="${row.name}"/></td>
                                    <td><c:out value="${row.quantity}"/></td>
                                    <td>
                                        <a href="ProductView.jsp?id=<c:out value="${row.id}"/>">View</a>
                                        <a href="ProductEdit.jsp?id=<c:out value="${row.id}"/>">Edit</a>
                                        <a href="ProductDel.jsp?id=<c:out value="${row.id}"/>">Delete</a>
                                    </td>
                                </tr>
                            </c:forEach>
                        </table>
                    </div>
                </div>
            </div>
        </div>
     <%@ include file="footer.jsp" %>
